﻿//
// Gns_TwoCodeWnd.cpp
//
//
// Created by yjf
//
//

#include "Gns_GameSetting.h"
#include "cocostudio/CocoStudio.h"
#include "ui/CocosGUI.h"

USING_NS_CC;
using namespace cocostudio::timeline;
using namespace ui;

#define winsize Director::getInstance()->getVisibleSize()



Gns_GameSetting::Gns_GameSetting()
{
   
}

Gns_GameSetting::~Gns_GameSetting()
{
    
}

Gns_GameSetting* Gns_GameSetting::Create(string csbName,MOVABLE_TYPE showType, MOVABLE_TYPE hideType)
{
	auto wnd = new Gns_GameSetting();

	if (wnd && wnd->init(csbName,showType,hideType))
	{
		wnd->autorelease();
	}
	else
	{
		CC_SAFE_DELETE(wnd);
		wnd = nullptr;
	}
	
	return wnd;
}

bool Gns_GameSetting::init(string csbName,MOVABLE_TYPE showType, MOVABLE_TYPE hideType)
{
	if (!PopWnd::init(csbName))
	{
		return false;
	}
	if (!AddCloseButtonFromCsb("Button_3"))
	{
		return false;
	}
	
	_tShowType = showType;
	_tHideType = hideType;

	return true;
}

void Gns_GameSetting::doEvent(cocos2d::Ref *pSender, ui::Widget::TouchEventType type){
    if (type==ui::Widget::TouchEventType::ENDED) 
	{
        auto pButton = (Button*)pSender;
        int BtnTag = pButton->getTag();
        switch (BtnTag) 
		{
		case 0:
			break;
		default:
			break;
        }
    }
}